asterisk-13.x: remove build timestamp
authorAlexander Couzens <[email protected]>
Wed, 6 Dec 2017 01:04:09 +0000 (02:04 +0100)
committerAlexander Couzens <[email protected]>
Wed, 6 Dec 2017 20:26:15 +0000 (21:26 +0100)
Build timestamps prevent reproducible builds [0].
Thanks to debian for the patch.

[0] https://reproducible-builds.org/docs/timestamps/

Signed-off-by: Alexander Couzens <[email protected]>
net/asterisk-13.x/Makefile
net/asterisk-13.x/patches/100-build-reproducibly.patch [new file with mode: 0644]

index 9e4f45ddc198f9f4b2727328a63f6572ecdce0f1..381d88d0747538366b3d9861f44fbdec7d2692a9 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk13
 PKG_VERSION:=13.18.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
diff --git a/net/asterisk-13.x/patches/100-build-reproducibly.patch b/net/asterisk-13.x/patches/100-build-reproducibly.patch
new file mode 100644 (file)
index 0000000..23e1f01
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/build_tools/make_build_h
++++ b/build_tools/make_build_h
+@@ -5,6 +5,14 @@
+ OS=`uname -s`
+ USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
+ DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
++if [ -n "${SOURCE_DATE_EPOCH}" ]; then
++      # building reproducibly, faking some data
++      HOSTNAME='buildd.debian.org'
++      KERNEL='unknown'
++      MACHINE='unknown'
++      USER='nobody'
++      DATE=`date -u "+%Y-%m-%d %H:%M:%S" -d @${SOURCE_DATE_EPOCH}`
++fi
+ cat << END
+ /*
+  * build.h
+--- a/Makefile
++++ b/Makefile
+@@ -465,7 +465,7 @@
+       @echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
+       @for x in $(MOD_SUBDIRS); do \
+               printf "$$x " ; \
+-              for i in `find $$x -name '*.c'`; do \
++              for i in `find $$x -name '*.c' | LC_ALL=C sort`; do \
+                       $(AWK) -f build_tools/get_documentation $$i >> $@ ; \
+               done ; \
+       done